#ifndef __SERIAL_H
#define __SERIAL_H

#ifdef __cplusplus
 extern "C" {
#endif
   
#include "System.h"

#if ENABLE_UART
	 
#include "SysFifo.h"
	 

#define USART_NUM			1

#define ENABLE_UART_DMA_IDLE	0
#define UART_BUFF_LEN			1024	 
	
typedef struct {
	UART_HandleTypeDef 	*uart;
	DMA_HandleTypeDef 	*uDMATx;
	DMA_HandleTypeDef 	*uDMARx;
}UartHandle_T;
typedef struct{
	void 			(*init)(void);
	int 			(*sendArray)(UINT8,UINT8 *,UINT32);

}UartDriver_T;

extern UartDriver_T	g_uartDriver;
extern FifoBuf_T   	g_uartBuff[USART_NUM];

int 	Serial_SendArray(UINT8 _prot,UINT8 *_buff,UINT32 _len);
void 	Serial_Init(void);
	


#endif
#ifdef __cplusplus
}
#endif
#endif

